package com.market.plus.core.domain;

import com.market.plus.core.exception.ExceptionCode;
import com.market.plus.core.exception.TypeCodeException;
import com.market.plus.core.exception.UnsupportTypeException;
public enum AlbumType {
   AVATAR(0), PERSONAL(1), TRIPE(2);

   private int albumType;

   public int getAlbumType() {
      return albumType;
   }

   private AlbumType(int albumType) {
      this.albumType = albumType;
   }

   public static AlbumType getAlbumType(int albumType) throws UnsupportTypeException {
      AlbumType value = null;
      switch (albumType) {
      case 0:
    	  value = AVATAR;
         break;
      case 1:
    	  value = PERSONAL;
         break;
      case 2:
         value = TRIPE;
          break;
      default:
    	 throw new UnsupportTypeException(ExceptionCode.instance(TypeCodeException.class, TypeCodeException.ALBUMTYPE));
      }
      return value;
   }
}
